<!DOCTYPE html>



  


<html class="theme-next mist use-motion" lang="zh-CN">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.3" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.3">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.3">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.3">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.3" color="#222">





  <meta name="keywords" content="Hexo, NexT" />





  <link rel="alternate" href="/atom.xml" title="Likianta Blog" type="application/atom+xml" />






<meta name="description" content="上章我们定义了一个VERSION变量，用于切换开发环境和实测环境。 比如我的工作文件夹为： F:\Workspace\LikiantaProjects\LK AE Subtitle Scripts for Fansub\LK_SubtitleScripts 我的AE软件的ScriptUI Panels路径为： C:\Program Files\Adobe\Adobe After Effects">
<meta property="og:type" content="article">
<meta property="og:title" content="204 获取子脚本实例">
<meta property="og:url" content="https://likianta.coding.me/2018/0214-221740/index.html">
<meta property="og:site_name" content="Likianta Blog">
<meta property="og:description" content="上章我们定义了一个VERSION变量，用于切换开发环境和实测环境。 比如我的工作文件夹为： F:\Workspace\LikiantaProjects\LK AE Subtitle Scripts for Fansub\LK_SubtitleScripts 我的AE软件的ScriptUI Panels路径为： C:\Program Files\Adobe\Adobe After Effects">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2018-02-14T14:17:40.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="204 获取子脚本实例">
<meta name="twitter:description" content="上章我们定义了一个VERSION变量，用于切换开发环境和实测环境。 比如我的工作文件夹为： F:\Workspace\LikiantaProjects\LK AE Subtitle Scripts for Fansub\LK_SubtitleScripts 我的AE软件的ScriptUI Panels路径为： C:\Program Files\Adobe\Adobe After Effects">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    version: '5.1.3',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://likianta.coding.me/2018/0214-221740/"/>





  <title>204 获取子脚本实例 | Likianta Blog</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Likianta Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tutorials">
          <a href="/tags/tutorial-catalog/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            教程
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://likianta.coding.me/2018/0214-221740/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Likianta">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="http://ozurciydg.bkt.clouddn.com/18-2-12/72826549.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Likianta Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">204 获取子脚本实例</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-02-14T22:17:40+08:00">
                2018-02-14
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/lk-ae-subtitlescript/" itemprop="url" rel="index">
                    <span itemprop="name">LK字幕脚本开发</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  1,010
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                  5
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <a id="more"></a>
<p>上章我们定义了一个<code>VERSION</code>变量，用于切换开发环境和实测环境。</p>
<p>比如我的工作文件夹为：</p>
<p><code>F:\Workspace\LikiantaProjects\LK AE Subtitle Scripts for Fansub\LK_SubtitleScripts</code></p>
<p>我的AE软件的<code>ScriptUI Panels</code>路径为：</p>
<p><code>C:\Program Files\Adobe\Adobe After Effects CC 2017\Support Files\Scripts\ScriptUI Panels\LK_SubtitleScripts</code></p>
<p>那么我要分别获取二者的子脚本路径：</p>
<h1 id="获取子脚本路径"><a href="#获取子脚本路径" class="headerlink" title="获取子脚本路径"></a>获取子脚本路径</h1><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="comment">// LK Subtitle Generator.jsx</span></span><br><span class="line">    <span class="comment">// LK字幕生成工具</span></span><br><span class="line">    <span class="comment">//</span></span><br><span class="line">    <span class="comment">// 发布注意：发布前请将`var VERSION = 'DEVELOP'`注释掉，并启用`var VERSION = 'RELEASE'`</span></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">function</span> <span class="title">LK_SubtitleGenerator</span>(<span class="params">thisObj</span>)</span></span><br><span class="line"><span class="function">    </span>&#123;</span><br><span class="line">        <span class="keyword">var</span> scriptName = <span class="string">"LK Subtitle Generator"</span>; <span class="comment">// 脚本标题</span></span><br><span class="line">        <span class="keyword">var</span> VERSION = <span class="string">'DEVELOP'</span>; <span class="comment">// 切换到“开发者版本”</span></span><br><span class="line">        <span class="comment">//var VERSION = 'RELEASE'; // 切换到“发布版本”</span></span><br><span class="line"></span><br><span class="line">        ...</span><br><span class="line"></span><br><span class="line">        <span class="comment">// 初始化值</span></span><br><span class="line">        <span class="comment">// 新增四个变量</span></span><br><span class="line">        <span class="keyword">var</span> file = <span class="literal">null</span>; <span class="comment">// 文件对象</span></span><br><span class="line">        <span class="keyword">var</span> CONSOLE_EDT = <span class="literal">null</span>; <span class="comment">// 静态对象，用于在开发者模式下的信息输出框（EditText）</span></span><br><span class="line">        <span class="keyword">var</span> CONSOLE_WIN = <span class="literal">null</span>; <span class="comment">// 静态对象，用于在开发者模式下的信息输出窗口</span></span><br><span class="line">        <span class="keyword">var</span> SCRIPT_FILE = <span class="string">'/LK Subtitle Import.jsxbin'</span>; <span class="comment">// 静态值，表示`Import`按钮关联的脚本文件</span></span><br><span class="line">        ...</span><br><span class="line"></span><br><span class="line">        <span class="comment">// 下面对静态值进行预处理</span></span><br><span class="line">        <span class="comment">// 相关回顾：[04 LK脚本基本框架](https://likianta.coding.me/2018/0211-180245/)</span></span><br><span class="line">        <span class="function"><span class="keyword">function</span> <span class="title">presetStaticValues</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line">            <span class="comment">// 一、INDEX &amp; FPS</span></span><br><span class="line">            <span class="comment">// 相关回顾：[04 LK脚本基本框架](https://likianta.coding.me/2018/0211-180245/)</span></span><br><span class="line">            ...</span><br><span class="line"></span><br><span class="line">            <span class="comment">// 二、SCRIPT_FILE</span></span><br><span class="line">            file = <span class="keyword">new</span> File($.fileName); <span class="comment">// 获得父脚本的绝对路径</span></span><br><span class="line">            <span class="comment">// ↑ 比如`C:/Program Files/Adobe/Adobe After Effects CC 2017/Support Files/Scripts/ScriptUI Panels/LK_SubtitleScripts/LK Subtitle Generator.jsxbin`</span></span><br><span class="line">            <span class="keyword">if</span> (VERSION == <span class="string">'RELEASE'</span>) &#123; <span class="comment">// 发布版关联的子脚本的路径</span></span><br><span class="line">                SCRIPT_FILE = <span class="keyword">new</span> File(file.path + SCRIPT_FILE);</span><br><span class="line">                <span class="comment">// ↑ 其值为`C:/Program Files/Adobe/Adobe After Effects CC 2017/Support Files/Scripts/ScriptUI Panels/LK_SubtitleScripts/LK Subtitle Import.jsx`</span></span><br><span class="line">                <span class="keyword">if</span> (!SCRIPT_FILE.exists) &#123;</span><br><span class="line">                    <span class="comment">// 如果上述文件不存在，则看看是不是用了中文文件名</span></span><br><span class="line">                    SCRIPT_FILE = <span class="keyword">new</span> File(file.path + <span class="string">'/LK字幕导入工具.jsxbin'</span>);</span><br><span class="line">                    <span class="keyword">if</span> (!SCRIPT_FILE.exists) &#123;</span><br><span class="line">                        <span class="comment">// 如果中文文件名也不存在，则会提示找不到子脚本，并提示用户手动查找该脚本</span></span><br><span class="line">                        alert(<span class="string">'Script file missed. You can browse it manually.'</span>, <span class="string">'Prompt'</span>);</span><br><span class="line"></span><br><span class="line">                        <span class="comment">// 打开文件对话框</span></span><br><span class="line">                        <span class="comment">// 相关学习：[02 JS打开文件选择对话框](https://likianta.coding.me/2018/0211-213555/)</span></span><br><span class="line">                        SCRIPT_FILE = File.openDialog (<span class="string">"Look for 'LK Subtitle Import.jsxbin'"</span>,</span><br><span class="line">                            [<span class="string">"Adobe Script File Binary:*.jsxbin"</span>, <span class="string">"Adobe Script File:*.jsx"</span>, <span class="string">"All Files:*.*"</span>],</span><br><span class="line">                            <span class="literal">false</span>);</span><br><span class="line"></span><br><span class="line">                        <span class="comment">// 如果用户什么都不选（点了取消），则最后提醒一下“部分功能将无法正常工作”</span></span><br><span class="line">                        <span class="keyword">if</span> (SCRIPT_FILE == <span class="literal">null</span>) &#123;</span><br><span class="line">                            alert(<span class="string">'Script file missed. Import function disabled.'</span>, <span class="string">'Warning'</span>);</span><br><span class="line">                            <span class="keyword">return</span>;</span><br><span class="line">                        &#125;</span><br><span class="line">                    &#125;</span><br><span class="line">                &#125;</span><br><span class="line">            &#125; <span class="keyword">else</span> <span class="keyword">if</span> (VERSION == <span class="string">'DEVELOP'</span>) &#123; <span class="comment">// 开发版关联此脚本</span></span><br><span class="line">                <span class="comment">// 开发模式就比较简单了，直接查找开发路径下的文件即可</span></span><br><span class="line">                SCRIPT_FILE = <span class="keyword">new</span> File(file.path + <span class="string">'/LK Subtitle Import.jsx'</span>);</span><br><span class="line">                <span class="comment">// ↑ 获得`F:/Workspace/LikiantaProjects/LK AE Subtitle Scripts for Fansub/LK_SubtitleScripts/LK Subtitle Import.jsx`</span></span><br><span class="line"></span><br><span class="line">                <span class="comment">// 三、在开发者模式中新建一个窗口，作为调试输出窗口</span></span><br><span class="line">                CONSOLE_WIN = <span class="keyword">new</span> Window(<span class="string">"palette"</span>, <span class="string">'Console (Output Test)'</span>, [<span class="number">750</span>,<span class="number">100</span>,<span class="number">1150</span>,<span class="number">575</span>], &#123;<span class="attr">resizeable</span>:<span class="literal">false</span>&#125;);</span><br><span class="line">                CONSOLE_EDT = CONSOLE_WIN.add(<span class="string">"edittext"</span>, [<span class="number">2</span>,<span class="number">2</span>,<span class="number">398</span>,<span class="number">473</span>], <span class="string">'Print Log: \n'</span>, &#123;<span class="attr">multiline</span>:<span class="literal">true</span>, <span class="attr">wantReturn</span>:<span class="literal">true</span>&#125;);</span><br><span class="line">                <span class="comment">// ↑ 第四个参数：`multiline`表示允许自动换行；`wantReturn`表示允许用户回车换行</span></span><br><span class="line">                CONSOLE_WIN.show();</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        presetStaticValues(); <span class="comment">// 执行预处理函数</span></span><br><span class="line"></span><br><span class="line">        ...</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    LK_SubtitleGenerator(<span class="keyword">this</span>); <span class="comment">// 执行该函数</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>自此，我们成功获得了子脚本。</p>
<p>此时再去看<a href="https://likianta.coding.me/2018/0211-213555/">02 JS打开文件选择对话框</a>，我们就能融会贯通了：</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="comment">// LK Subtitle Generator.jsx</span></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">function</span> <span class="title">LK_SubtitleGenerator</span>(<span class="params">thisObj</span>)</span></span><br><span class="line"><span class="function">    </span>&#123;</span><br><span class="line">        ...</span><br><span class="line"></span><br><span class="line">        <span class="function"><span class="keyword">function</span> <span class="title">onBtn5Click</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line">            <span class="comment">// 导入字幕文件（会弹出文件选择对话框）</span></span><br><span class="line"></span><br><span class="line">            <span class="comment">//var SCRIPT_FILE = new File('F:/Workspace/LikiantaProjects/LK AE Subtitle Scripts for Fansub/LK_SubtitleScripts/LK Subtitle Import.jsx');</span></span><br><span class="line">            SCRIPT_FILE.open(<span class="string">'r'</span>);</span><br><span class="line">            content = <span class="built_in">eval</span>(SCRIPT_FILE.read()); <span class="comment">// `eval`函数可读取并执行一个脚本对象</span></span><br><span class="line">            <span class="comment">// ↑ 因为我们的父脚本中已经有一个`content`变量，可用其接收子脚本返回的对象</span></span><br><span class="line">            <span class="comment">// 返回值包含了ass字幕文件的文本内容（类似于下图的文字，不过换行符都用`\n`表示了）。</span></span><br><span class="line">            <span class="comment">// ![查看图片](http://ozurciydg.bkt.clouddn.com/18-2-14/56083756.jpg)</span></span><br><span class="line">            SCRIPT_FILE.close();</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    LK_SubtitleGenerator(<span class="keyword">this</span>); <span class="comment">// 执行该函数</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h1 id="运行效果"><a href="#运行效果" class="headerlink" title="运行效果"></a>运行效果</h1><blockquote>
<p>下章链接：<a href="https://likianta.coding.me/2018/0220-214327/">301 LK正则匹配工具概述</a></p>
</blockquote>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      
      
        <div class="post-widgets">
        

        

        
          
          <div id="needsharebutton-postbottom">
            <span class="btn">
              <i class="fa fa-share-alt" aria-hidden="true"></i>
            </span>
          </div>
        
        </div>
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/0214-132942/" rel="next" title="203 使用VERSION变量控制版本输出">
                <i class="fa fa-chevron-left"></i> 203 使用VERSION变量控制版本输出
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/0219-182858/" rel="prev" title="字幕in＆out讲解">
                字幕in＆out讲解 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      <div id="lv-container" data-id="city" data-uid="MTAyMC8zNDI4MS8xMDgxOA=="></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="http://ozurciydg.bkt.clouddn.com/18-2-12/72826549.jpg"
                alt="Likianta" />
            
              <p class="site-author-name" itemprop="name">Likianta</p>
              <p class="site-description motion-element" itemprop="description">Android Dev</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">73</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">8</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">2</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="http://blog.csdn.net/likianta" target="_blank" title="CSDN">
                      
                        <i class="fa fa-fw fa-crosshairs"></i>CSDN</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:sheerish@qq.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/likianta" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://weibo.com/5441767757/profile?rightmod=1&wvr=6&mod=personinfo" target="_blank" title="Weibo">
                      
                        <i class="fa fa-fw fa-weibo"></i>Weibo</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#获取子脚本路径"><span class="nav-text">获取子脚本路径</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#运行效果"><span class="nav-text">运行效果</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="copyright">&copy; 2017 &mdash; <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Likianta</span>

  
</div>


  <div class="powered-by">
    <i class="fa fa-user-md"></i>
    <span id="busuanzi_container_site_pv">
      Site visitors:<span id="busuanzi_value_site_pv"></span>
    </span>
  </div>

<!--
  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Mist</a> v5.1.3</div>

-->



<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">Site words total count:75.2k</span>
</div>
        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.3"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.3"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.3"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.3"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.3"></script>



  


  




	





  





  
    <script type="text/javascript">
      (function(d, s) {
        var j, e = d.getElementsByTagName(s)[0];
        if (typeof LivereTower === 'function') { return; }
        j = d.createElement(s);
        j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
        j.async = true;
        e.parentNode.insertBefore(j, e);
      })(document, 'script');
    </script>
  












  





  

  

  

  
  
  
  <link rel="stylesheet" href="/lib/needsharebutton/needsharebutton.css">

  
  
  <script src="/lib/needsharebutton/needsharebutton.js"></script>

  <script>
    
      pbOptions = {};
      
          pbOptions.iconStyle = "box";
      
          pbOptions.boxForm = "horizontal";
      
          pbOptions.position = "bottomCenter";
      
          pbOptions.networks = "Weibo,Wechat,Douban,QQZone,Evernote";
      
      new needShareButton('#needsharebutton-postbottom', pbOptions);
    
    
  </script>

  

  

  

  

</body>
</html>
